home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / BAUDRATE.C next >
Text File  |  1992-11-21  |  2KB  |  53 lines

  1. #include <limits.h>
  2. #define CURSES_LIBRARY 1
  3. #include <curses.h>
  4. #undef baudrate
  5.  
  6. #ifndef        NDEBUG
  7. char *rcsid_baudrate = "$Header: c:/curses/portable/RCS/baudrate.c%v 2.0 1992/11/15 03:28:45 MH Rel $";
  8. #endif
  9.  
  10.  
  11.  
  12.  
  13. /*man-start*********************************************************************
  14.  
  15.   baudrate()   - Return terminal baud rate
  16.  
  17.   X/Open Description:
  18.        Returns the output speed of the terminal.  The number returned
  19.        is bits per second, for example 9600, and is an integer.
  20.  
  21.   PDCurses Description:
  22.        If FAST_VIDEO is true, then this is the largest possible
  23.        (portable) int value (INT_MAX from limits.h) IF direct
  24.        video is possible, OR the approximate guess at BIOS speeds,
  25.        19200.
  26.  
  27.        If FAST_VIDEO is false, this is an approximate guess at BIOS
  28.        speeds, 19200.
  29.  
  30.   X/Open Return Value:
  31.        The baudrate() function returns a pointer to a verbose description
  32.        of the current terminal on success and the null pointer on error.
  33.  
  34.   X/Open Errors:
  35.        No errors are defined for this function.
  36.  
  37.   Portability:
  38.        PDCurses                int baudrate( void );
  39.        X/Open Dec '88          int baudrate( void );
  40.        BSD Curses
  41.        SYS V Curses
  42.  
  43. **man-end**********************************************************************/
  44.  
  45. int    baudrate(void)
  46. {
  47. #ifdef FAST_VIDEO
  48.        return (_cursvar.direct_video ? INT_MAX : 19200 );
  49. #else
  50.        return (19200);                 /* Approx. guess at BIOS speeds.*/
  51. #endif
  52. }
  53.